]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
telepathyClient: Stop displaying presence in notification
authorJulian Sparber <julian@sparber.net>
Thu, 25 Jan 2024 16:54:09 +0000 (17:54 +0100)
committerMarge Bot <marge-bot@gnome.org>
Tue, 30 Jan 2024 17:05:23 +0000 (17:05 +0000)
The presence indicator in notification uses API only needed for the
telepathyClient, since it's a complete fringe feature nowadays it's not
worth maintaining specific API for it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3103>

js/ui/components/telepathyClient.js

index 778c8e7e03929ab3b5e34eb4a49d2551824dcd3e..a40879ff54f00e39253d24e58701243a6c2c0e5e 100644 (file)
@@ -332,8 +332,7 @@ class ChatSource extends MessageTray.Source {
 
         this._contact.connectObject(
             'notify::alias', this._updateAlias.bind(this),
-            'notify::avatar-file', this._updateAvatarIcon.bind(this),
-            'presence-changed', this._presenceChanged.bind(this), this);
+            'notify::avatar-file', this._updateAvatarIcon.bind(this), this);
 
         // Add ourselves as a source.
         Main.messageTray.add(this);
@@ -393,35 +392,6 @@ class ChatSource extends MessageTray.Source {
             return new Gio.ThemedIcon({name: 'avatar-default'});
     }
 
-    getSecondaryIcon() {
-        let iconName;
-        let presenceType = this._contact.get_presence_type();
-
-        switch (presenceType) {
-        case Tp.ConnectionPresenceType.AVAILABLE:
-            iconName = 'user-available';
-            break;
-        case Tp.ConnectionPresenceType.BUSY:
-            iconName = 'user-busy';
-            break;
-        case Tp.ConnectionPresenceType.OFFLINE:
-            iconName = 'user-offline';
-            break;
-        case Tp.ConnectionPresenceType.HIDDEN:
-            iconName = 'user-invisible';
-            break;
-        case Tp.ConnectionPresenceType.AWAY:
-            iconName = 'user-away';
-            break;
-        case Tp.ConnectionPresenceType.EXTENDED_AWAY:
-            iconName = 'user-idle';
-            break;
-        default:
-            iconName = 'user-offline';
-        }
-        return new Gio.ThemedIcon({name: iconName});
-    }
-
     _updateAvatarIcon() {
         this.iconUpdated();
         if (this._notification) {
@@ -630,15 +600,6 @@ class ChatSource extends MessageTray.Source {
         }
     }
 
-    _presenceChanged(_contact, _presence, _status, _message) {
-        if (this._notification) {
-            this._notification.update(
-                this._notification.title,
-                this._notification.bannerBodyText,
-                {secondaryGIcon: this.getSecondaryIcon()});
-        }
-    }
-
     _pendingRemoved(channel, message) {
         let idx = this._pendingMessages.indexOf(message);
 
@@ -674,9 +635,8 @@ const ChatNotification = HAVE_TP ? GObject.registerClass({
         'timestamp-changed': {param_types: [ChatNotificationMessage.$gtype]},
     },
 }, class ChatNotification extends MessageTray.Notification {
-    _init(source) {
-        super._init(source, source.title, null,
-            {secondaryGIcon: source.getSecondaryIcon()});
+    constructor(source) {
+        super(source, source.title, null, null);
         this.setUrgency(MessageTray.Urgency.HIGH);
         this.setResident(true);